using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class DisableAfterTime:MonoBehaviour {
	void OnEnable() { time=0; }

	void Update() {
		time+=Time.deltaTime;
		if(time>timeTotal) gameObject.SetActive(false);
	}

	float time;
	[SerializeField] float timeTotal;
}
